<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>日志管理</title>
<block th:replace="commonBase"></block>   
</head>
<body>
 	  <div style="width:100%;">
        <div class="mini-toolbar" style="border-bottom:0;padding:0px;">
            <table style="width:100%;">
                <tr>
                	 <td style="width:100%;">
                	 	  <!--  <a class="mini-button"  plain="true" iconCls="icon-addnew" >添加</a>
						   <a class="mini-button"  plain="true" iconCls="icon-edit">编辑</a>
						   <a class="mini-button"  plain="true" iconCls="icon-remove">删除</a>
						   <a class="mini-button"  plain="true" iconCls="icon-lock">锁定</a>
						   <a class="mini-button"  plain="true" iconCls="icon-unlock">解锁</a>
						   <a class="mini-button"  plain="true" iconCls="icon-reload">刷新</a>
						   <a class="mini-button"  plain="true" iconCls="icon-search">查看</a>
						   <a class="mini-button"  plain="true" iconCls="icon-download">下载</a>
						   <a class="mini-button"  plain="true" iconCls="icon-print">打印</a>
						   <a class="mini-button"  plain="true" iconCls="icon-filter">筛选</a>
						   <a class="mini-button"  plain="true" iconCls="icon-expand">高级搜索</a>-
						   <a class="mini-button"  plain="true" iconCls="icon-save">保存</a>
						   <a class="mini-button"  plain="true" iconCls="icon-ok">确定</a>
						   <a class="mini-button"  plain="true" iconCls="icon-cancel">取消</a>
						   
						   <a class="mini-button"  plain="true" iconCls="icon-upload">导入</a>
						   <a class="mini-button"  plain="true" iconCls="icon-download">导出</a>
						   <a class="mini-button"  plain="true" iconCls="icon-undo">批量导入</a> -->
					  <input id="select2" class="mini-treeselect" th:attr="url=@{/tempjson/gist/region.txt}"  multiSelect="false"  showTreeIcon="true" width="230" expandOnLoad="0"
								        textField="text" valueField="id" parentField="pid" value="110000"  
								        allowInput="true" showRadioButton="false" showFolderCheckBox="false"></input>
						    <input id="searchKey" class="mini-textbox" emptyText="请输入操作内容" style="width:250px;" onenter="search"/>   
                        	<a class="mini-button" iconCls="icon-search" onclick="search()">查询</a> 
                        	
                            <a class="mini-button"  plain="true" iconCls="icon-print">打印</a>
						    <a class="mini-button"  plain="true" iconCls="icon-redo">批量导出</a>  
                    </td>
                </tr>
            </table>           
        </div>
    </div>
    <div class="mini-fit">
		<div id="grid1" class="mini-datagrid"
			style="width:100%;height:100%;" 
			allowCellSelect="true" multiSelect="true" allowAlternating="true" sortField="operate_date" sortOrder="desc" idField="id" pageSize="50" sizeList="[10,20,50,100]"
			 th:attr="url=@{/log/pagelist}"  >
			<div property="columns">
				<div field="operateUserId"  sortField="operate_user_id" width="100" allowSort="true">操作人</div>
				<div field="operateType" sortField="operate_type" width="100" allowSort="true" renderer="onOptRenderer">操作类型</div>
				<div field="moduleType" sortField="module_type" width="100" allowSort="true">操作对象</div>
				<div field="operateDate" width="120" dataType="date" dateFormat="yyyy-MM-dd HH:mm:ss" renderer="ondayRenderer">操作时间</div>
				<div field="content" width="500" >操作内容</div>
			</div>
		</div>
	</div>
</body>
<script th:inline="javascript" type="text/javascript">
 /*<![CDATA[*/

var grid =  null;//表格对象
$(function(){
	  mini.parse();
	  grid = mini.get("grid1");
	  grid.load();	  
});


function search(){
	var  searchKey= mini.get("searchKey").getValue();
	if(searchKey!=""){
		grid.load({"searchPhrase":searchKey});
	}else{
		grid.load();
	}

}


var openU = [{ id: 1, text: '增加' }, { id:2, text: '删除'} ,{ id:3, text: '修改'}];
function onOptRenderer(e) {
    for (var i = 0, l = openU.length; i < l; i++) {
        var g = openU[i];
        if (g.id == e.value) return g.text;
    }
    return "";
}

function ondayRenderer(e){
	//alert();
	
		var operateDate = e.value;
       	if(!operateDate){
       		return "";
       	}
        return format(operateDate, 'yyyy-MM-dd HH:mm:ss');
}

/*]]>*/
</script>
</html>